<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>pyswap: SwapServer::SwapServer Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="panStamp_web.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">pyswap
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><b>SwapServer</b>      </li>
      <li class="navelem"><a class="el" href="classSwapServer_1_1SwapServer.html">SwapServer</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a>  </div>
  <div class="headertitle">
<div class="title">SwapServer::SwapServer Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="SwapServer::SwapServer" -->
<p>SWAP server class.  
 <a href="classSwapServer_1_1SwapServer.html#details">More...</a></p>

<p><a href="classSwapServer_1_1SwapServer-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3735b77b8b2f732e60294b1f23b02db1"></a><!-- doxytag: member="SwapServer::SwapServer::run" ref="a3735b77b8b2f732e60294b1f23b02db1" args="" -->
def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSwapServer_1_1SwapServer.html#a3735b77b8b2f732e60294b1f23b02db1">run</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Start SWAP server thread. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a369dd1af190f06957bdb99a5098250dc"></a><!-- doxytag: member="SwapServer::SwapServer::stop" ref="a369dd1af190f06957bdb99a5098250dc" args="" -->
def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSwapServer_1_1SwapServer.html#a369dd1af190f06957bdb99a5098250dc">stop</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Stop SWAP server. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a09657bc10b288d968a46fed35f55d5c1"></a><!-- doxytag: member="SwapServer::SwapServer::stopped" ref="a09657bc10b288d968a46fed35f55d5c1" args="" -->
def&#160;</td><td class="memItemRight" valign="bottom"><b>stopped</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab57b93cb937d57cec0f89f01ed8ccd97"></a><!-- doxytag: member="SwapServer::SwapServer::resetNetwork" ref="ab57b93cb937d57cec0f89f01ed8ccd97" args="" -->
def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSwapServer_1_1SwapServer.html#ab57b93cb937d57cec0f89f01ed8ccd97">resetNetwork</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Clear SWAP network. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSwapServer_1_1SwapServer.html#aff408fffbc7fddedab5f7bac4a0d5fcb">getNbOfMotes</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the amounf of motes available in the list.  <a href="#aff408fffbc7fddedab5f7bac4a0d5fcb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSwapServer_1_1SwapServer.html#a0715795bbd9a8b39e7e39127a168324c">getMote</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return mote from list given its index or address.  <a href="#a0715795bbd9a8b39e7e39127a168324c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSwapServer_1_1SwapServer.html#a57c3808dd318db8d9c1d03fd0e9ac966">setMoteRegister</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set new register value on wireless mote Non re-entrant method!!  <a href="#a57c3808dd318db8d9c1d03fd0e9ac966"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSwapServer_1_1SwapServer.html#a2d08b9aa909bef170fccefbaa8a1778d">queryMoteRegister</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Query mote register, wait for response and return value Non re-entrant method!!  <a href="#a2d08b9aa909bef170fccefbaa8a1778d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSwapServer_1_1SwapServer.html#a692b8712656894fad315025843df569f">getNetId</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get current network ID.  <a href="#a692b8712656894fad315025843df569f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSwapServer_1_1SwapServer.html#a2ffec9031dbcedbbec9506c4c193b09f">__init__</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Class constructor.  <a href="#a2ffec9031dbcedbbec9506c4c193b09f"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a717fc6809ef33098b0b50997450e38e9"></a><!-- doxytag: member="SwapServer::SwapServer::modem" ref="a717fc6809ef33098b0b50997450e38e9" args="" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSwapServer_1_1SwapServer.html#a717fc6809ef33098b0b50997450e38e9">modem</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Serial wireless gateway. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a61775a3b070deaa7945b35ff69297763"></a><!-- doxytag: member="SwapServer::SwapServer::is_running" ref="a61775a3b070deaa7945b35ff69297763" args="" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSwapServer_1_1SwapServer.html#a61775a3b070deaa7945b35ff69297763">is_running</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Ture if server is running. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae96cd18d98f6a3e717fc6d49e627ffcb"></a><!-- doxytag: member="SwapServer::SwapServer::lstMotes" ref="ae96cd18d98f6a3e717fc6d49e627ffcb" args="" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSwapServer_1_1SwapServer.html#ae96cd18d98f6a3e717fc6d49e627ffcb">lstMotes</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">List of SWAP motes available in the network. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a25fe39bf6a0562e84d89aa1e389227d8"></a><!-- doxytag: member="SwapServer::SwapServer::verbose" ref="a25fe39bf6a0562e84d89aa1e389227d8" args="" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSwapServer_1_1SwapServer.html#a25fe39bf6a0562e84d89aa1e389227d8">verbose</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Verbose SWAP frames. <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>SWAP server class. </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a2ffec9031dbcedbbec9506c4c193b09f"></a><!-- doxytag: member="SwapServer::SwapServer::__init__" ref="a2ffec9031dbcedbbec9506c4c193b09f" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">def SwapServer::SwapServer::__init__ </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>eventHandler</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>settings</em> = <code>None</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>verbose</em> = <code>False</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>start</em> = <code>True</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Class constructor. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">eventHandler,:</td><td>Parent event handler object </td></tr>
    <tr><td class="paramname">settings,:</td><td>path to the main configuration file </td></tr>
    <tr><td class="paramname">verbose,:</td><td>Verbose SWAP traffic </td></tr>
    <tr><td class="paramname">start,:</td><td>Start server upon creation if this flag is True </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a0715795bbd9a8b39e7e39127a168324c"></a><!-- doxytag: member="SwapServer::SwapServer::getMote" ref="a0715795bbd9a8b39e7e39127a168324c" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">def SwapServer::SwapServer::getMote </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>index</em> = <code>None</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>address</em> = <code>None</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return mote from list given its index or address. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">index,:</td><td>Index of hte mote within lstMotes </td></tr>
    <tr><td class="paramname">address,:</td><td>Address of the mote</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>mote </dd></dl>

</div>
</div>
<a class="anchor" id="aff408fffbc7fddedab5f7bac4a0d5fcb"></a><!-- doxytag: member="SwapServer::SwapServer::getNbOfMotes" ref="aff408fffbc7fddedab5f7bac4a0d5fcb" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">def SwapServer::SwapServer::getNbOfMotes </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the amounf of motes available in the list. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Amount of motes available in lstMotes </dd></dl>

</div>
</div>
<a class="anchor" id="a692b8712656894fad315025843df569f"></a><!-- doxytag: member="SwapServer::SwapServer::getNetId" ref="a692b8712656894fad315025843df569f" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">def SwapServer::SwapServer::getNetId </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get current network ID. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Network ID </dd></dl>

</div>
</div>
<a class="anchor" id="a2d08b9aa909bef170fccefbaa8a1778d"></a><!-- doxytag: member="SwapServer::SwapServer::queryMoteRegister" ref="a2d08b9aa909bef170fccefbaa8a1778d" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">def SwapServer::SwapServer::queryMoteRegister </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>mote</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>regId</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Query mote register, wait for response and return value Non re-entrant method!! </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">mote,:</td><td>Mote containing the register </td></tr>
    <tr><td class="paramname">regId,:</td><td>Register ID</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>register value </dd></dl>

</div>
</div>
<a class="anchor" id="a57c3808dd318db8d9c1d03fd0e9ac966"></a><!-- doxytag: member="SwapServer::SwapServer::setMoteRegister" ref="a57c3808dd318db8d9c1d03fd0e9ac966" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">def SwapServer::SwapServer::setMoteRegister </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>mote</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>regId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set new register value on wireless mote Non re-entrant method!! </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">mote,:</td><td>Mote containing the register </td></tr>
    <tr><td class="paramname">regId,:</td><td>Register ID </td></tr>
    <tr><td class="paramname">value,:</td><td>New register value</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>True if the command is correctly ack'ed. Return False otherwise </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>/home/daniel/development/Aptana/pyswap/src/SwapServer.py</li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Fri Dec 9 2011 16:23:28 for pyswap by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
